function numJewelsInStones(J: string, S: string): number {
  let ans = 0
  const len = S.length
  const set = new Set(J)
  for (let i = 0; i < len; i += 1) set.has(S[i]) && (ans += 1)
  return ans
}

export { numJewelsInStones }
